#ifndef __SCHEMA_H__
#define __SCHEMA_H__

#include "globalDecl.h"
using namespace std;

typedef struct NameType 
{
	Type type;
	char * name;
	int index;
}NameType;

class Schema 
{
	private:
		NameType * m_NT;
		map <string, NameType> m_schemaCounts;
		int m_count;
		std::string m_name;
public:


	// this function goes to the text file called fName and loads in
	// the schema for relation relName
	Schema (char *_relName, char *_fName);

	~Schema ();

	// this tries to find the specified attribute and returns a 1 or a 0
	// depending upon whether or not the attribute has been found
	int Find (char *_attName);

        // this gets the type of the given attribute
	Type GetType (char *_attName);
	Type GetType(int _place);
	//This take a char * and returns the name of the relation, given a placement
	void GetName(char * &_name, int _place);
	int GetPlace(char * _attName); //returns place , or -1 if can't find
	//This prints the Schema
	void Print();
	void PrintName();
	void PrintLn(int _i);
	int GetAttrCount();
	int GetLength(int _place);
	Schema (const Schema &s); 
};

#endif
